package com.zy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zy.entity.Email;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface EmailMapper extends BaseMapper<Email> {

    @Select("SELECT COUNT(1) FROM email WHERE user_id=#{uid} and flag=0")
    public Integer getEmailNum(Integer uid);

    @Insert("insert into email(user_id,content,date) values(#{userId},#{content},#{date})")
    public void addEmail(Email email);

}
